package com.zhanghe.study.feign;

import com.zhanghe.study.feign.fallback.DeptClientFallBackFactory;
import com.zhanghe.study.model.Dept;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author zh
 * @date 2021/8/23 15:48
 */
@FeignClient(value = "MICRO-SERVICE-DEPT-PROVIDER",fallbackFactory = DeptClientFallBackFactory.class)
public interface DeptClient {

    @RequestMapping(value = "/dept/get/{id}",method = RequestMethod.GET)
    Dept get(@PathVariable("id") long id);
}
